package com.neo.rabbit.object;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.neo.model.User;

@Component
public class ObjectSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send( User user ) {
        System.out.println( "Sender object: " + user.toString() );
        this.rabbitTemplate.convertAndSend( "object", user );
    }

}